fix(sdk): correct endpoints and improve type safety#478
Open
fix(sdk): correct endpoints and improve type safety#478
Conversation
- Fix createOrgDiffScanFromIds endpoint URL (/diff-scans → /diff-scans/from-ids)
and replace QueryParams with properly typed options (after, before, description, external_href, merge)
- Add getDiffScanGfm method for /orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm endpoint
- Add getSupportedFiles method for /orgs/{org_slug}/supported-files endpoint (non-deprecated)
- Fix createRepository options type with specific fields instead of generic QueryParams
- Split RepositoryItem type: RepositoryListItem (for list endpoint) and RepositoryItem (for get endpoint)
to remove integration_meta and slig from list results where they're not available
- Add unit tests for all new methods and updated signatures
jhiesey
approved these changes
Feb 10, 2026
Member
jhiesey
left a comment
There was a problem hiding this comment.
LGTM except we should tighten up the type on createRepository to match the code not the schema
Make createRepository signature consistent with other repository methods by requiring orgSlug and repoSlug as separate parameters, with optional params as the third argument. Before: createRepository(orgSlug, params?) After: createRepository(orgSlug, repoSlug, params?) This matches the pattern used in getRepository, updateRepository, and deleteRepository methods for consistent API design.
8c00dbe to
8afc332
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes five SDK bugs with incorrect endpoints and weak typing:
Changes
Endpoint Fixes
/diff-scans→/diff-scans/from-ids/orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm/orgs/{org_slug}/supported-filesType Improvements
QueryParamswith typed options (after,before,description,external_href,merge)QueryParamswith specific typed fields (name,description,homepage,visibility,archived,default_branch,workspace)RepositoryListItem(for list endpoint) andRepositoryItem(for get endpoint) to remove fields only available on get (integration_meta,slig)Testing